package com.mysterymall.Service;

import com.mysterymall.Common.Utils.Result;
import com.mysterymall.Model.Dto.OrderDto;
import com.mysterymall.Model.Dto.UpdateOrderDto;
import com.mysterymall.Model.Dto.WithdrawDto;
import com.mysterymall.Model.Entity.OrderInfo;
import com.mysterymall.Model.Entity.WithdrawDeposit;

import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @ClassName com.mysterymall.Service
 * @Description
 * @Author HuangWX
 * @Time 2023/12/02  17:41
 */
public interface OrderInfoService {


    /**
     * 创建订单
     *
     * @param orderDto 订单信息
     * @return boolean
     */
    Map<String, Object> insertOrder(OrderDto orderDto);


    /**
     * 取消订单
     * @param orderId 订单id
     * @return boolean
     */
    boolean cancelOrder(String orderId);

    /**
     * 查询所有订单
     * @param type 订单类型
     * @param currIndex 当前页
     * @param pageSize 每页条数
     * @return Result
     */
    Result getAllOrder(String type, Integer currIndex, Integer pageSize,HttpServletRequest request);


    /**
     * 查询我的订单
     * @param type 订单类型
     * @param currIndex 当前页
     * @param pageSize 每页条数
     * @return Result
     */
    Result getMyAllOrder(String type, Integer currIndex, Integer pageSize, HttpServletRequest request);

    /**
     * 查询订单详情
     * @param orderCode 订单编号
     * @param request 请求头
     * @return Result
     */
    Result getOrderInfo(String orderCode,HttpServletRequest request);


    /**
     * 提货
     * @param goodsId 商品id
     * @return OrderInfo
     */
    Result pickUpGoods(String goodsId,String addressId);


    /**
     * 申请提现
     * @param amount 提现金额
     * @return Result
     */
    Result applyForWithdrawal(BigDecimal amount);


    /**
     * 获取提现列表
     * @param currIndex 当前页
     * @param pageSize 每页条数
     * @param status 提现状态
     * @return Result
     */
    Result getWithdrawDepositList(Integer currIndex, Integer pageSize, String status);


    /**
     * 修改提现状态
     * @param withdrawDto 提现数据
     * @return Result
     */
    Map<String,Object> updateWithdrawDepositStatus(WithdrawDto withdrawDto);


    /**
     * 获取我的提现列表
     * @param currIndex 当前页
     * @param pageSize 每页条数
     * @param status 提现状态
     * @return Result
     */
    List<WithdrawDeposit> getMyWithdrawDepositList(Integer currIndex, Integer pageSize, String status);


    /**
     * 提现和退款
     * @param withdrawDeposit 提现信息
     */
    void WithdrawalAndRefund(WithdrawDeposit withdrawDeposit);


    /**
     * 查询订单状态
     * @param orderStatus 订单状态
     * @param currIndex 当前页
     * @param pageSize 每页条数
     * @return Result
     */
    Result queryStatus(String orderStatus, String currIndex, String pageSize);


    /**
     * 修改订单状态
     * @param updateOrderDto 订单信息
     * @return Result
     */
    Result updateOrderStatus(UpdateOrderDto updateOrderDto);


    // 修改提现状态
    void updateWithdrawDepositStatus(WithdrawDeposit withdrawDeposit);

    Result getPaymentOrder(Integer currIndex, Integer pageSize, String search,HttpServletRequest request, String type,String time);
}
